Title: SQL W3S (By-BKK) / 011 Null
Tags: Obsidian_to_Anki

Q: What is a NULL value in SQL?
A: A field with no value

Q: True/False: NULL is the same as zero or a field with spaces
A: False

Q: When is a field saved with a NULL value?
A: When no data is entered or updated for that field

Q: How do you test for NULL values in SQL?
A: Use IS NULL or IS NOT NULL operators

Q: Can you use = or <> to compare NULL values?
A: No

Q: What is the syntax for selecting NULL values?
A: SELECT column_names FROM table_name WHERE column_name IS NULL

Q: How do you select records with non-empty values?
A: Use IS NOT NULL

Q: Show an example selecting customers with Address NULL
A: SELECT CustomerName, ContactName, Address FROM Customers WHERE Address IS NULL

Q: Show an example selecting customers with Address not NULL
A: SELECT CustomerName, ContactName, Address FROM Customers WHERE Address IS NOT NULL

Q: Why use IS NULL instead of comparison operators?
A: Comparison operators do not work with NULL

Q: A field with no value
A: What is a NULL value in SQL?

Q: False
A: Is NULL the same as zero or a field containing spaces?

Q: SELECT CustomerName, ContactName, Address FROM Customers WHERE Address IS NULL
A: Show an example selecting customers with Address NULL

Q: IS NULL and IS NOT NULL
A: How do you test for NULL values in SQL?